package com.vimi8.ebb.auth.api;

import com.vimi8.ebb.auth.configuration.HttpResponseEntity;
import com.vimi8.ebb.auth.dto.AuthUserDto;
import com.vimi8.ebb.auth.dto.UserDto;
import com.vimi8.ebb.auth.model.*;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringCodegen", date = "2016-09-12T05:17:54.080Z")

@RestController
@Api(value = "user", description = "the user API")
public interface UserApi {

    @ApiOperation(value = "发送验证码", notes = "发送验证码到用户手机.", response = String.class, tags={ "注册登录", })
    @ApiResponses(value = {
        @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
        @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/user/codes/",
        method = RequestMethod.POST)
    HttpResponseEntity<String> userCodesPost(@ApiParam(value = "验证码发送的目标手机号.", required = true) @RequestParam(value = "phoneNumber", required = true) String phoneNumber


            , @ApiParam(value = "发起调用的客户端id.", required = false) @RequestParam(value = "clientId", required = false) String clientId

            , HttpServletRequest request
    );

    @ApiOperation(value = "不需要输入手机号发送验证码", notes = "根据用户原手机号 发送验证码到用户手机", response = String.class, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/user/me/codes/",
            method = RequestMethod.POST)
    HttpResponseEntity<String> userCodesPost1( HttpServletRequest request
    );


    @ApiOperation(value = "更新密码", notes = "通过旧密码更新密码.", response = String.class,  tags={ "个人信息", })
    @ApiResponses(value = {
        @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
        @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/user/password/",
        method = RequestMethod.PUT)
    HttpResponseEntity<String> userPasswordPut(
            @ApiParam(value = "旧密码.", required = true) @RequestParam(value = "oldPassword", required = true) String oldPassword
            , @ApiParam(value = "新密码.", required = true) @RequestParam(value = "newPassword", required = true) String newPassword
            , @ApiParam(value = "verifyCode.", required = false) @RequestParam(value = "verifyCode", required = false) String verifyCode,
            HttpServletRequest request

    );


    @ApiOperation(value = "注册新用户", notes = "通过传递信息注册新用户.", response = String.class, tags={ "注册登录", })
    @ApiResponses(value = {
        @ApiResponse(code = 200, message = "成功,返回更新ID后的用户信息", response = String.class),
        @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/user/",
        method = RequestMethod.POST)
    HttpResponseEntity<Token> userPost(

            @ApiParam(value = "个人的注册信息", required = true) @RequestBody RegUser regUser
            , HttpServletRequest request

    );


    @ApiOperation(value = "更新除密码外的个人信息", notes = "通过当前认证信息获取当前登录人的个人信息.", response = String.class, tags={ "个人信息", })
    @ApiResponses(value = {
        @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
        @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/user/",
        method = RequestMethod.PUT)
    HttpResponseEntity<String> userPut(

            @ApiParam(value = "需要更新的个人信息", required = true) @RequestBody AuthUserDto AuthUserDto

    );
    @ApiOperation(value = "查询个人信息", notes = "通过当前认证信息获取当前登录人的个人信息.", response = AuthUserDto.class,tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = AuthUserDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = AuthUserDto.class) })
    @RequestMapping(value = "/user/me/",
            method = RequestMethod.GET)
    HttpResponseEntity<AuthUserDto> userMeGet();

    @ApiOperation(value = "查询用户信息", notes = "查询用户信息.", response = AuthUserDto.class,tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = AuthUserDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = AuthUserDto.class) })
    @RequestMapping(value = "/user/",
            method = RequestMethod.GET)
    HttpResponseEntity<AuthUserDto> userGet(   @ApiParam(value = "clientId", required = false) @RequestParam(value = "clientId", required = false) String clientId,
                                               @ApiParam(value = "openId", required = false) @RequestParam(value = "openId", required = false) String openId);


    @ApiOperation(value = "查询没有被雇佣的员工列表", notes = "查询没有被雇佣的用户列表.", response = AuthUser.class, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = AuthUser.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = AuthUser.class) })
    @RequestMapping(value = "/user/notemp/",
            method = RequestMethod.GET)
    HttpResponseEntity<Paginator<List<AuthUserDto>>> userNotempGet(
            @ApiParam(value = "用户名或者手机号", required = false) @RequestParam(value = "key", required = false) String key,
            @ApiParam(value = "是否是贫困户", required = false) @RequestParam(value = "isPoor", required = false) String isPoor,
            @ApiParam(value = "当前页", required = true) @RequestParam(value = "page", required = true) Integer page
            , @ApiParam(value = "每页大小", required = true) @RequestParam(value = "pageSize", required = true) Integer pageSize);


    @ApiOperation(value = "查询没有被雇佣的股东列表", notes = "查询没有被雇佣的用户列表.", response = AuthUser.class, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = AuthUser.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = AuthUser.class) })
    @RequestMapping(value = "/user/notshareholder/",
            method = RequestMethod.GET)
    HttpResponseEntity<Paginator<List<AuthUserDto>>> userNotShareholderGet(
            @ApiParam(value = "用户名或者手机号", required = false) @RequestParam(value = "key", required = false) String key,
            @ApiParam(value = "是否是贫困户", required = false) @RequestParam(value = "isPoor", required = false) String isPoor,
            @ApiParam(value = "当前页", required = true) @RequestParam(value = "page", required = true) Integer page
            , @ApiParam(value = "每页大小", required = true) @RequestParam(value = "pageSize", required = true) Integer pageSize);




    @ApiOperation(value = "查询我的雇主", notes = "查询我的雇主.", response = AuthUserDto.class, authorizations = {
            @Authorization(value = "accessCode", scopes = {
                    @AuthorizationScope(scope = "read:auth-server:user:me", description = "资源auth-server下个人用户信息的读取权限.")
            })
    }, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = AuthUserDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = AuthUserDto.class) })
    @RequestMapping(value = "/user/employer/",
            method = RequestMethod.GET)
    HttpResponseEntity<AuthUserDto> userEmployerGet();


    @ApiOperation(value = "根据clientId查询用户信息", notes = "根据clientId查询用户信息.", response = AuthUser.class, authorizations = {

    }, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = AuthUser.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = AuthUser.class) })
    @RequestMapping(value = "/user/queryInfoById/{clientId}",
            method = RequestMethod.GET)
    HttpResponseEntity<AuthUser> userInfoByClientGet(

            @ApiParam(value = "clientid", required = true) @PathVariable String clientId
    );


    @ApiOperation(value = "修改用户信息", notes = "修改用户信息.", response = Integer.class, authorizations = {

    }, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = Integer.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = Integer.class) })
    @RequestMapping(value = "/user/collec/",
            method = RequestMethod.PUT)
    HttpResponseEntity<Integer> userInfoUsingPUT(

            @ApiParam(value = "authUser", required = true) @RequestBody AuthUser authUser
    );

    @ApiOperation(value = "设置头像", notes = "修改头像.", response = String.class, authorizations = {

    }, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/user/headImg/",
            method = RequestMethod.PUT)
    HttpResponseEntity<String> settingHeadImagesPUT(

            @ApiParam(value = "头像", required = true) @RequestParam String headImg
    );

    @ApiOperation(value = "设置姓名", notes = "修改姓名.", response = String.class, authorizations = {

    }, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/user/name/",
            method = RequestMethod.PUT)
    HttpResponseEntity<String> settingNamePUT(

            @ApiParam(value = "姓名", required = true) @RequestParam String name,
            @ApiParam(value = "身份证", required = true) @RequestParam(required = false) String idCard,
            @ApiParam(value = "身份证照片", required = true) @RequestParam(required = false) String idCardImg

    );



    @ApiOperation(value = "设置电话号码", notes = "修改电话号码.返回1表示修改成功，返回-1表示该手机号已存在，返回0表示修改失败。", response = String.class, authorizations = {

    }, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/user/phone/",
            method = RequestMethod.PUT)
    HttpResponseEntity<String> settingPhonePUT(

            @ApiParam(value = "电话号码", required = true) @RequestParam String newPhoneNumber,
            @ApiParam(value = "旧手机验证码", required = false) @RequestParam(required = false) String oldVerifyCode,
            @ApiParam(value = "新手机验证码", required = false) @RequestParam(required = false) String newVerifyCode,
            HttpServletRequest request
    );


    @ApiOperation(value = "设置地址", notes = "修改地址.", response = String.class, authorizations = {

    }, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/user/address/",
            method = RequestMethod.PUT)
    HttpResponseEntity<String> settingAddressPUT(

            @ApiParam(value = "地址代码", required = true) @RequestParam String addressCode,
            @ApiParam(value = "地址详情", required = true) @RequestParam String addressDetail
    );

    @ApiOperation(value = "验证原密码是否正确", notes = "验证原密码是否正确.", response = String.class, authorizations = {

    }, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/user/checkPwd/",
            method = RequestMethod.GET)
    HttpResponseEntity<String> checkOldPwdPUT(

            @ApiParam(value = "原密码", required = true) @RequestParam String oldPassword
    );


    @ApiOperation(value = "检查验证码是否正确", notes = "检查验证码是否正确.正确则可以修改手机号和密码", response = String.class, authorizations = {

    }, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class) })
    @RequestMapping(value = "/user/checkCode/",
            method = RequestMethod.GET)
    HttpResponseEntity<String> verifyCodePUT(

            @ApiParam(value = "验证码", required = true) @RequestParam String verifyCode,
            HttpServletRequest request
    );


    @ApiOperation(value = "根据openId查询用户信息", notes = "根据openId查询用户信息", response = UserDto.class, authorizations = {

    }, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = UserDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = UserDto.class) })
    @RequestMapping(value = "/user/me/info/",
            method = RequestMethod.POST)
    HttpResponseEntity<List<UserDto>> UserMeInfoPUT(

            @ApiParam(value = "openId数组", required = true) @RequestParam("openIdList") String openIdList
    );

    @ApiOperation(value = "根据openId查询所有所属组织ClientId", notes = "根据openId查询所有所属组织ClientId", response = UserDto.class, authorizations = {

    }, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = UserDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = UserDto.class) })
    @RequestMapping(value = "/user/me/orgInfo/",
            method = RequestMethod.POST)
    HttpResponseEntity<List<String>> QueryOrgIdPOST();



    @ApiOperation(value = "打卡", notes = "当前用户打卡", response = UserDto.class, authorizations = {

    }, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = UserDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = UserDto.class) })
    @RequestMapping(value = "/user/clock/",
            method = RequestMethod.POST)
    HttpResponseEntity<String> PunchClockPOST(
            @ApiParam(value = "打卡对象", required = true) @RequestBody PunchClock punchClock
    );



    @ApiOperation(value = "查询当前登录用户打卡记录", notes = "查询当前登录用户打卡记录", response = UserDto.class, authorizations = {

    }, tags={ "个人信息", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,用户信息", response = UserDto.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = UserDto.class) })
    @RequestMapping(value = "/user/clock/",
            method = RequestMethod.GET)
    HttpResponseEntity<Map> PunchClockGET(
            @ApiParam(value = "开始页码", required = true) @RequestParam int start,
            @ApiParam(value = "页面大小", required = true) @RequestParam int size

    );



}
